package org.zjx.common.route;


import org.zjx.common.entity.Address;

public class AbstractRoute implements IRoute {
    protected Address startAddress;
    protected Address endAddress;
    protected int time;

    public AbstractRoute() {}

    public AbstractRoute(Address startAddress, Address endAddress, int time) {
        this.startAddress = startAddress;
        this.endAddress = endAddress;
        this.time = time;
    }

    @Override
    public Address getStart() {
        return startAddress;
    }

    @Override
    public Address getEnd() {
        return endAddress;
    }

    @Override
    public int getTime() {
        return time;
    }

    @Override
    public String toString() {
        return String.format("[路径]%s->%s(%d)", startAddress, endAddress, time);
    }
}
